package edu.scau.pos.service;

import com.alipay.api.AlipayApiException;
import com.fasterxml.jackson.core.JsonProcessingException;
import edu.scau.core.exection.BusinessProcessException;
import edu.scau.pos.domain.Sale;
import edu.scau.pos.vo.SaleLineItemVo;
import edu.scau.pos.vo.SaleVo;

import java.util.Map;

public interface SaleService {
    /**
     * 开启销售
     * @return saleId currentSale的key
     */
    public String startNewSale();

    public int getProductStock(String productSn) ;

    /**
     * 结束销售,返回销售总额、数量,saleI必需属性
     * @param saleVo
     * @return saleResult
     */
    public Map<String,Object> endSale(SaleVo saleVo) ;

    /**
     * 支付订单
     * @param saleId
     * @return 200
     */
    public String makePayment(String saleId) throws AlipayApiException, JsonProcessingException, BusinessProcessException;

    public boolean judgeStock(SaleLineItemVo saleLineItemVo) ;

    public Map checkOrderStatus(String saleId) throws AlipayApiException, JsonProcessingException, BusinessProcessException;
}
